<template>
  <van-nav-bar :title="pageTitle" :left-text="leftText" :left-arrow="leftArrow" @click-left="onClickLeft" fixed/>
</template>

<script>
export default {
  computed: {
    pageTitle() {
      return this.$route.meta.title;
    },
    leftText() {
      return this.$route.name == 'home' ? '' : '返回';
    },
    leftArrow() {
      return this.$route.name == 'home' ? false : true;
    }
  },
  methods: {
    onClickLeft() {
      this.$router.history.go(-1);
    }
  }
};
</script>

<style lang="less" scoped="scoped">
//因为设置了lang="less"所以采用/deep/的方式进行样式穿透
.van-nav-bar--fixed {
  background-color: #dfecee;
}

/deep/ .van-nav-bar__title {
  color: black;
  font-size: 22px;
  font-weight: 550;
  letter-spacing: 0.08em;

}

/deep/ .van-nav-bar__content {
  background: white; //对应了导航栏的背景色的修改
  padding-top: 5px;
  padding-bottom: 5px;
}

/deep/ .van-nav-bar__text {
  color: black;
  font-size: 18px !important;
}

/deep/ .van-icon {
  color: black;
}


/deep/ .van-icon {
  color: black !important;

}
</style>
